package com.zzty.train.dao;


import com.zzty.train.entity.Question;
import com.zzty.train.util.PageUtils;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface QuestionDao {
    @Insert("insert into question (content) values(#{content})")
    Integer addContent(Question question);

    @Select("select * from question")
    List<Question> getAllQuestion();

    @Select("select * from question")
    public List<Question> getQuestion();

    @Select("select count(*) from question")
    public Integer getQuestionCount();

    @Select("select * from question limit #{pageNo} , #{pageSize}")
    public List<Question>getPageQuestion(PageUtils pageUtils);

    @Insert("insert into question (content) values (#{content})")
    public Integer addQuestion(Question question);
}
